package com.zkny.zknyerp.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * 设备实体类
 */
@Data
@Table(name = "erp_device")
public class Device {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer id;     //主键ID
    private String imei;    //设备唯一标识
    private String name;    //设备名称
    private Integer modelid;  //设备型号关联ID
    private String typeid;   //设备类型关联ID
    private Integer scenarioid;  //设备场景关联ID
    private String devkey;   //设备激活码
    private String status;   //设备状态:1.未绑定  2.已绑定
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date bindtime;        //绑定时间

    @Transient
    private String model;      //设备型号
    @Transient
    private String scenario;      //设备场景
    @Transient
    private String type;      //设备类型

}
